from manim import *

class app(Scene):
    def construct(self):
        dot_a = Dot([0,0,0])    # 点
        dot_b = Dot([4,2,0])    # 点
        line = Line(dot_a.get_center(), dot_b.get_center()).set_color(ORANGE)

        b1 = Brace(line)    # 大括号
        b1_text = b1.get_text("Horizontal distance")

        b2 = Brace(line, direction=line.copy().rotate(PI/2).get_unit_vector())
        b2_text = b2.get_tex("x-x_1")
        self.add(line, dot_a, dot_b, b1, b1_text, b2, b2_text)
        